Fix MemoryFileStore which confused files and directories with common prefix