Catch divide-by-0 when there are no public methods

Fixes #15