Fix a division by zero when MaxKeys = 0. Closes gh-1.