Fix target-finding bug