Clean up code and terminate app on certain errors

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