Bug fix for missing outer curly braces on encode.