Add check for zero numerator to fraction reduce function