Remove extra closing tags to validate HTML