Problem with fitting 2D gaussian using constraints

Hello,
I have data which I would like to fit to a 2D Gaussian. I have been fitting the data without constraints, but noise in the data makes it hard to get consistent results without constraining to only fit the center of the peak to the gaussian function. The issue I am having is that, while the fit works just fine when I use the curve fitting window under "analysis", however when I put the same command in my code I get wierd results. Here is the snippet of code that fits the data to a 2D Gaussian

Function Gaussianfit(data, w1, w3)
Wave data
Wave w1
Wave w3
duplicate data g_fit
//string gaussfit
Make/O/D gcoefs={0, -0.05, 2049.3, 3.5, 2047.2, 3.5, 0.3}
Make/O/T/N=7 T_Constraints
T_Constraints[0] = {"K1< 0","K2 > 0","K3 > 0","K4 > 0","K5 > 0","K6 > 0","K6<1"}
CurveFit/NTHR=0/G Gauss2D, kwCWave=gcoefs, data /X=w1 /Y=w3 /D=g_fit/C=T_Constraints
//CurveFit/NTHR=0/G Gauss2D kwCWave=gcoefs, data[34,38][135,145] /X=w1 /Y=w3 /D=g_fit /C=T_Constraints //This is where the problem is
Return gcoefs[6]
//ModifyContour gaussfit labels=0
//ModifyContour gausswvnm rgbLines=(0,0,0)
End

I have attached the experiment file to this post. The black contour on the graph is the wierd fit from when I run my code, the blue is the good fit from when I do it from the macro. The rainbow is the raw data. If anyone has insights for me it would help me tremendously.

-Phil
GaussFit_Constraints_Test.ipf (7.49 KB) GaussFit_Constraints_Test.pxp (1.35 MB)
Hello Again,
It appears there is still a problem. I have included 2 files, one where I do not fit with constraints, one where I do. After I do the fit, I then plot the resulting 2D Gaussian from the fit on top of my original data. In the file where I don't fit with constraints, the gaussian fit is displayed fine. In the file where I do fit with constraints, rather than display the fit on top of my data, it redisplays my data ( appears to only be negative values) on my graph. It seems that, rather than make a wave which is the fit, it simply just returns the input data. Please let me know if you have any feedback. Thank you.