Use assignment rather than memcpy
Fix various segfault and memory issues
Fix bad test logic for adjacent wires
Change test to only have one conditional