Added support for self-closing tags