Fixes sys.exit() problem