Fixed generation of code using wmeyer advice
Fixing C++ code in example
Code of lib fixed