Even more robust handling of temp library during restore