Cleanup when namespace is unloaded.