Fix variable name in error handling.