Fix multiplication by zero bug.

Probably need a manual merge since the diff is based off of @dsimcha's original code. But it should be obvious enough.