Added a better error handling for corrupted region files