Fix divide by zero bug <Karthik>