Be defensive and don't mod by zero if denominator somehow gets set to
zero