Cleaning up some files and minor bugs