Prevent a possible divide by zero crash.
Merge pull request #404 from TeoTwawki/misc

Prevent a possible divide by zero crash.