Error handling for unexpected data