Minor change to error checks