Multiple fixes, related to issue #457