small fix for next_name()