Remove duplicate error checks