Fixed some bugs in the resource system and in the container extractor/importer