Fix cursor search and add example to test code.