Fix typo in error handling