Fix of logic error in determining expected status code to use for tests