Bi presence fixes

Patches from Bogdan.