I went through this over the last couple of days myself, kept getting a 16XX error when trying to restore a custom firmware in itunes. So I had to downgrade to 3.0 using iREB, then used redsn0w to JB 3.0, then was able to custom restore to 3.1.2... what a hassle!
Would it have been easier using Blackrain?