fix scripts and generated files
replace packN() functions with generated version
replace unpackN() functions with generated version