Minor fixes in order to close the connections opened during the import
process.