Did some cleanup and other fixes