FIXed some bugs found when working on gariety.xxx. HTML encode/decode
templates, etc.