Add row_to_dict function.