Fix crashes with file system - must be closed