Fix bug where closeElement with a prefix included the prefix in the name