Fixes #1030
Fixes #1031
Merge pull request #1033 from emmanuel-keller/1.6

Bug fixes