Properly check for exceptions