Fixed bug with lsearch