Fixed problem of misplaced and missing tags.