clean up wires, correctly handle limits