Fix bug in --expect returning the wrong result.