Fixed some transformation issues in the gates/wires