More porting fixes