Fixing the BDB test and reorganizing some tests