Fixed unclosed `if` block