Fix divide by 0 exception.