Adding external code references and more robust namespace handling.