Fix missing curly braces and adjust some formatting.