Fixed a potential divide by zero
Merge pull request #382 from peastman/master

Fixed a potential divide by zero