Make sure it works when root is a file and not a folder