Bugfix in renderhtmltemplate