fix some 32-bit compile bugs