I downgraded from 5.1 to 5.0.2 and then did the jailbreak. Everything was going fine until the iTunes restore step then I kept getting error 1604 after repeated attempts. Apple support says this has to do with the USB cable/port. I started out doing this on a 2009 13" Macbook Pro. Then I switched to my 11" Macbook Air and the jailbreak completed just fine. I don’t know if this was just coincidence or not but if anyone is geting the 1604 error, you might want to try a different USB cable/port or another computer.
This worked for me http://forum.firecore.com/topic/9015 uninstall and re install i tunes