Fixed is.factor to return single scalar