Just to document the procedure I used to upgrade from 3.1.2 to 3.1.3.

Using iphone 3GS with MC model number.

I had previously using 3.1.2 and the blackra!n jailbreak successfully. I needed to upgrade to 3.1.3 to install an app.

I downloaded the 3.1.3 stock apple firmware and used iTunes 9.2 to restore it to my phone. Note that I have an entry in my hosts file for gs.apple.com to point to saurik's server. Next I downloaded the spirit "fixed" jailbreak tool and ran it and it completed successfully.

I rebooted and all was well. I plugged it into iTunes and it ask me if this was a restore or new iphone. I chose the restore option and it pulled in my existing apps and settings.

Finally I installed rockapp and logged into it with my ID. I restored all of my JB apps and all is well.