Merge "Fix error checking in append_string"