Fix StackOverflow exception, getReferences() is returning a reference for him self, added a check for this.