Fixed out of memory bug when finding all references