Fix plot_dist in case factors with NA