Fix potential 64 bit shift bug