Minor fixes

Minor-fixes, see the individual commit messages for details.