Fix bad porting