Attached diff contains potential fix. It looks all values are calculated correctly but in the last step, when array content is generated, instead of array of pointers, array of unsigned char is generated. In this step all values are truncated. Changed code checks if array contains pointers.