small changes for porting