Small fixes from PR #603

--rebased-from #605

Some extra fixes were added to #603 when it was rebased into dev_4_4, so we are now back-porting these to develop.