fix #1905 (a review of PR #1913 + tests)

fixes #1905 (a review of PR #1913 + tests)