    * @return {*}                   Value of `prop` if no `value` specified
   ###
   env.addGlobal 'config', (prop, value, merge = true) ->
-    ctx           = this.ctx
+    ctx           = @ctx
     ctxValue      = _.get(ctx, prop)
     valueIsArray  = Array.isArray(value)
     valueIsObject = typeof value == 'object' and value and not valueIsArray

  ###
  env.addFilter 'spread', (input, delimiter = ' ') ->
    if typeof input != 'object'
      grunt.log.error('[spread] input should be object, but `' + typeof input + '` has been specified', '[' + this.ctx.page.href + ']')
      return

    spreaded = ' '

   * @todo Related issue https://github.com/mozilla/nunjucks/issues/783
  ###
  env.addFilter 'render', (input, isCaller = false, logUndefined = false) ->
    render(env, @getVariables(), input, isCaller, grunt.log.error, logUndefined, @ctx.page.props.href)

  ###*
   * Replace placeholders with provided values. Refer to `printf` module for docs
