Fixed Gate update logic bug.