[FIX] Fixing some div-by-zero issues.
Merge pull request #628 from holtgrewe/feature/fix-div-by-zero

[FIX] Fixing some div-by-zero issues.