Various fixes to blz and its tests