Improve error handling for checked_pointer_cast
Improve error handling in CSVLoader