Fix the types for NumElements variables, and add a comment