fix #3115 (registerNamespaces with merging)
Merge pull request #3117 from quantum13/loader

[2.0.0] fix #3115 (registerNamespaces with merging)