Fixed a bug causing the removal of comments to slice away closing tags.