Made as.db.data.frame accept factor