Correct incorrect loop logic in dummy var fit