Some tweaks, fixes and cleanups.