Fixed a tiny bug with dividing by zero.