Various tweaks and improvements