Small fixes from PR #603

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