few more fixes from porting