Clean up code and terminate app on certain errors

See changelog_08_08_2014.txt for details of the changed made for each
module.