Fix close tags to help preserve document structural integrity

Take a look at my lengthy comment in the relevant commit. It better explains the problem I set out to solve.

TLDR? I close tags to give throw BeautifulSoup a bone so it does not destroy document structure =)