Fixing old Search/MR tests
Refactoring/cleanup