Remove sys.exit() and avoid zero dividing problem.