Add several checks to prevent division by zero (triggered by converting black).
Merge pull request #37 from dwbullok/master

Add several checks to prevent division by zero (triggered by converting ...