Actually halt on error and return the correct status code