Several small tweaks/bugfixes