Actually the last commit was in error, the number of primitives needs to compared against <= to the max number of primitives.