fixes potential divide-by-zero
Merge pull request #16 from thiagohersan/master

fixes potential divide-by-zero