Fix faulty logic.