Refactoring ._recursive_convert to use a ._flatten method.
Don't return the wrong cached value when parameters happen to be prefixes of each other.