Fixed bug in swap gates