Add functionnal CV generation. Correct some bugs.