Corrected bug in MoG.