Fixed a logic problem with failed and passed tests.