Fixing porting mistakes.