Minor fixes and cleanups