Added a null check for the namespace declaration parameter in the method linkRootModel()