Fixed div-by-zero bug.