Fix misgenerated grunt task when not using a template library

Yeah. At least when you do it by string manipulation. If I were writing this from scratch, I'd probably get esprima involved and manipulate it as a data structure.