Some changes to make the console.log thingy work in .tpl file.