Correcting logic for failed tests. EOM