Clean up deactivate code.