Various small tweaks and fixes