Fix for handling self-closing tags.