Ensure that denominator does not evaluate to 0

Reviewers: eater

Reviewed By: eater

Differential Revision: http://phabricator.khanacademy.org/D7853