Minor style and code fixes.

Fixed spacing around if and foreach statements. Fixed default
value of a variable to be an integer rather than a boolean.

Change-Id: Ia5f954b44d807c9f4acf796a19e5db02a62d8fb3