Various fixes

Some fixes and nitpicks.