Added braces around if statements.