Fixes #607
Fixes #608
Fixes #606