fixed bugs in schematic