Better error handling for bad sample files