fixing encoding problems for real this time
fixing problem with templates where they were calling private variables instead of public methods