Use object literals for error descriptions
Add missing braces