Fixed bug in multiple ref search