Replaces expectFailure with failure_to_success and fixes running in optimized.