Fixed bug in BP (introduced in commit b8f96214...) and added regression test for...