Removes unnecessary exit statements