Fix for Issue #31: Avoid referencing null object when a malformed closing tag is found in an html document