Made file loading more intelligent.