Fixed file-writing syntax