Fix logic for version presence check