treatments_unique_map was using length of a dataframe to get its own length. This was causing it to have the length of a dataframes column width. Changed to nrow. Now it should be the right length. I do not kow why this was working before.