Add several BDD tests and minor fixes