Fixed gate dupe bug.