Fixes #585
Unable to reproduce #552
Fixes #576