Fixed broken logic.