Added exit() to errors