Fixed infinite refursion in getReferences static method