progress towards fixing 64-bit assumptions etc