64-bit fixes for SampleGenerator