Fixed a fairly major bug which causes crashes.
Merge branch 'master' of https://github.com/matt5784/CS278