Add explicit braces and fix a warning