Fix issues with map registering/unregistering