Change exit to sys.exit