Fix bug when handling multiple core files