add as_factor test