Avoid dividing by 0. Fixes #99