Fixed curly braces for foreach and if-else statements