fixed more porting errors