Fixing a bug while adding missing curly braces