Fixed calc_g in mixturepoisson

I had the order of some nested for loops mixed up. Now it seems to be fitting
the data very nicely.