Towfigh,
A quick hack is to comment out that entire if statement you mentioned. I also commented out the add_filter for autoopsfix at the end of the file since I believe the issues it fixed have all been taken care of.
With that little modification I’ve had it working fine on WordPress 2.2 and 2.2.1 installs.
The only thing I haven’t checked the functionality of is multipaged posts (which I’ve never used) but otherwise there aren’t any major issues. So, that may help as a quick fix until we figure out exactly what’s going on (I’m just catching up on changes in 2.2 as I still use the 2.0.x line).
Regards,
Jason