[CODE STYLE] Corrected indentation and weird use of if/foreach syntax