Properly check errors