Logistic Regression: Fix crash if categorical variable has no distinct values