Bug fix: predict did not work for db.Rquery plus dummy variables

This bug caused "predict" runtime problem, and thus affected residuals,
vcov and margins.