fix 64 bit bug and assignement typos