Search added, errors refined, test cases updated