Fixes #457 and #461