Ok, if one copies the custom template from the wiki and paste it info your editor, the formatting is not correct. The wiki adds LF or other characters. So please make sure you have a clean custom template.
I'll ask Daniel if he can add the template fragment in smeserver-webapps-common