Fixed bad logic.