More template js fixes.