Fixed a bug: the rewriter had a syntax error with some undeclared identifiers