Fix bug when wrapping empty region would place closing tag inside opening tag.