[[ RefactorSyntax ]] Fixed save issues (crash and corrupted file generation)