added tests for component based search, fixed a few bugs