Added checkment for division by zero.