Fixed a gate error.