Fixed small oversight in WriteYAMLFile - won't crash if opening of the file for writing failed.