Fixed devision by zero bug