Fixed some odd behavior concerning the gate