Clean up whitespace in template output