Fix a division by zero when MaxKeys = 0. Closes gh-1.
Merge branch 'version2'