Fixes to various small issues