Fixing a bug saving to file system due to FS API differences