Fix rubocop warning about if conditionals