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