Fixing `element.attr()` to use namespace methods when appropriate