Changed how the HTTP status is determined.