Check for division by zero (closes #6)