Some safety checking for dividing by zero.