Major bugfix: need to cast uint32 as uint64 before left shifting.