Because I couldn't sleep from the heat in these parts (I think it was 23 or 24 degrees C outside, I worked a bit on your code, and concluded it contained no errors. But you already saw that yourself too.
I looked up the code for the 2D-FFT, and it looks like there are quite a lot of assumptions being made which could all too easily be broken if you don't follow NR's coding standard exactly. You need to grab the PDF for subchapter 12.4 to get an idea. But I trust you already figured that out too. Good luck with the code study, in any case.