fixed templates utils for php 5.3.