[2.0.0] fix #3115 (registerNamespaces with merging)

#3115