fix faulty logic in tests