Fixed an issue which caused import to run out of memory.