Fix integer conversion warnings to make 64 bit work