fixing bug in format_name logic; now can accept objects or dictionaries.