Fixed small bug where only the first element was being returned in search