Misc tweaks and general quality improvements