Fixing braces in an if statement