The whole breaking down paths business was really shady so I scrapped it.
Now, paths are continuously broken down on the recursive AddFile, AddDirectory and Get functions until they reach the last element of the path.