Initial fix of messenger template scope problems.