Fix a bug in build_BDD