Avoid divide by zero error with key_buffer_size

Fixes #35.