Fix logic error in testing whether a deployment exists.