MODE-1963 Fixed the code that was un-registering node types

The problem was caused by the fact that when a node type was unregistered, it was deleted from the cache but the parent references were not updated.