History bug regarding #2989 and #2963

Use brace here: `if() {} else {}`