Detecting errors correctly