Add an assertion to make sure we are not dividing by zero. (Found by scan-build)
Merge pull request #752 from hansjoachim/assertion

Add an assertion to make sure we are not dividing by zero.
Merge remote-tracking branch 'upstream/master'