Improved searching and tests.