Fixed a lot of stuff for final submission.