Added closing tags to the parsing algorithm.