Handle external defs and circular refs