Clean-up template from redundant spaces.