Cleanup and reset of relays