Script to generate all documents
Fixed a few memleaks
Replaced char* name in profile by a std::string to reduce memleaks