Fix incorrect logic.