Correct namespace for newly created member

Fixed a bug that occured when the newly created element doesn't belong to the same namespace as the wrapper.