Small fixes in chat and templates