Changed: TemplateHelper::normalize() preserves single spaces, TemplateOptimizer::optimize() doesn't
Fixed off-by-one error