Removed unused functions.
Fixing the criteriasearch bug.
Adding some minor TODO's