Fixed wires leaking signals from internal connections

- Wires shouldnt output to side r if it connects internally on that
side.
- Minor code cleanup