Better input loop exit and exit status