Fixed build with 5.2 to 5.4
Fixed primary define
Fixed constant name
Fixed double free (I didn't generate the *.c on purpose)