Fix issue #938 + some related improvements
3 files changed