Adds non-superfluous closing tags.