Fixed bug overwriting moments.