I don't think it is a bug, it sounds ok for this method to raise an error when the index is `maxOrd` (out of bounds)? However I think that your fix to create a bit set of size `maxOrd + 1` is good!