Test version loops up to mx+1,my+1 in loops where i+1,j+1 used.  I think these can be reduced to mx,my.
changed loops in fgmax_interpolate to go 0:mx, 0:my when setting a,b,c