Try not to crash when cores are corrupt (related to #1457).