Sounds like a typo somewhere, I would just put these debugging statements in a separate script and run it by itself - we're just trying to narrow down where the problem is, getting close - you shouldn't be getting a syntax error.