Fix bugs in FileSystem classes