BUG: fix off-by-one in dimensionality error message

The maximum allowed is really 32, not 31.
BUG: fix off-by-one in dimension error message

The maximum allowed is really NP_MAX_INT, not NP_MAX_INT-1.
Merge pull request #5061 from keszybz/fix-dimension-message

Fix dimension message