Fix bug in get_exact_name where n and m expansions did not work
Simplify get_exact_name side functions