Change h2o.factor to as.factor