Fixed append_file_line helper