Merge "Fix nextTag for end of document" into ub-mail-master