Remove unwanted whitespace
Fix division by zero

.. hopefully, at least.

Diagnosed by Joel Jacobson, untested fix by me.