Fixed crash caused by regressing with categorical variables