fixed handling of zeros
Merge pull request #8 from schp/master

Fixing issue #7. Thank you for contribution!