ensure_packages uses arrays only