Re-added the emergency reset and cleaned up some things.