Small fixes

A running pull request with any 'small' fixes.
It initially started to fix #1353, but I've added various other things over time