Minor fixes and cleanup