ActiveAE: fix segfault in GenerateNoise, better solution