Fixed nand and nor gate to work with more than two inputs