fixing bug in find() changes and adding some tests