Fix for #461

Fix for #461
Fix for #454

#461 needs pull request #455 to work.