Fixed  var bug in view templates.