Fixed porting errors.