Fix memleaks (valgrind) + fix json file causing thoses mem leaks (duplicated map keys)