Fix edge case for adding curly braces