Fix bug and add a test

Closes #3539389

Merge request reports

Loading