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.