Changed calls to exit() to calls to sys.exit() in order to support pyinstaller.