Fixing the criteriasearch bug.
Adding some minor TODO's