Fixed logic problem.