Tidied up ChunkManager and hopefully fixed a bug in the FileSystem