Fix undefined behavior when shifting left by 32 bits