Fix handling of NAs in classify.