Add int64 cast for correct multiply results on 32-bit systems