Fixes #3632, refactor/tweak pull request #34 merge.