Fixed test with wrong logic and errors.