Fixed "detached entities" bug for multiple imports.