Fix external reference assignment