In tools/modborrowers.pl branchcode is not mandatory field if it is not defined in BorrowerMandatoryField syspref. It missing causes errors in the tool. We could maybe circumvent this by always automatically adding branchcode to BorrowerMandatoryField syspref when user saves it, or with some other mechanism.