Fixed errors introduced by back porting a patch.