Fixed always exiting with status of 0 bug