Added braces on ifs (goto fail)