Changed number of inputs check in Gate.connect(). Changed number of max_inputs to 8 for every gate.