Fixed a bug in referenceEmitter()