Some tweaks and improvements