smaller fixes for porting errors