Added more tests.
Corrected errors in handling root level directory.