Fixed a problem with the discoverReferences stub function.