fix some const problems in marshalling code
fix some 64-bit printing problems