Fix namespace handling in self-closing tags