Fixed issues with porting