Modified qualified name logic for function lookups.