General fixes and tweaks