Updated lrlib_append_to_file