Fixed last minute bugs, and clean up