Fixed lots of bugs, made file size smaller, etc