Remove trailing space in template file