Fix pretty signification reference search bug which caused some references to be missed under certain conditions