Ok but does it Deparse to the same thing? If this doesn't help, try removing bits of code until you get a minimal reproduction case that you can share.
re: deparse...can I create an output file which I can then look at with 'diff'?
I piped the deparse output into another file....using vi on this file I can find the closing '}'....is there some diagnostic with deparse that show me the offending code?