General cleanup and fix broken wiring