Fix moments generation