Partially reverts feee9864. Add explicit braces to a different place to fix "error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else]"