Possibly make error checks faster