Minor fixes and cleaning up