More porting fixes.... still a lot to do!