Porting bug fix