more tests. better BT caching and fixed some bugs.