Fixed handling of error data