Passing term IDs as Integers for consistent comparisons with legends