fix #3115 (registerNamespaces with merging)