Fixed some minor bugs; attempted to fix sluggish feel when many gates are connected.