Fixes some bugs in find_functions and corrects spec.