Resolves incorrect closing of sub-menu lists in markup
Closes issue #17