fixing bug 1155, plus trouble deleting bank accounts

This fixes deleting bank accounts as well as the problems in bug 1155