Be more defensive in deactivate()