Fixed some code and cleaned up some files