Added self-closing tag flag; moved/added/changed a few methods