Added more resilient graph importing code.