diff --git a/cmd/master.go b/cmd/master.go
index 99d9cb38a18081b5160c68e0fd1df4f2bb7b459b..590d9786b451157fda5d140655fc35c4357e5383 100644
--- a/cmd/master.go
+++ b/cmd/master.go
@@ -16,6 +16,7 @@ package cmd
 
 import (
 	"fmt"
+	"os"
 
 	"github.com/aquasecurity/kube-bench/check"
 	"github.com/spf13/cobra"
@@ -36,6 +37,7 @@ var masterCmd = &cobra.Command{
 		filename := loadConfig(check.MASTER, bv)
 		runChecks(check.MASTER, filename, detecetedKubeVersion)
 		writeOutput(controlsCollection)
+		os.Exit(exitCodeSelection(controlsCollection))
 	},
 	Deprecated: "this command will be retired soon. Please use the `run` command with `--targets=master` instead.",
 }
diff --git a/cmd/node.go b/cmd/node.go
index 5672297d226807216f5568e6333be0aaa1f8a17b..63e8e289e07c957ec4a271b575c10a58b43d486a 100644
--- a/cmd/node.go
+++ b/cmd/node.go
@@ -16,6 +16,7 @@ package cmd
 
 import (
 	"fmt"
+	"os"
 
 	"github.com/aquasecurity/kube-bench/check"
 	"github.com/spf13/cobra"
@@ -36,6 +37,7 @@ var nodeCmd = &cobra.Command{
 		filename := loadConfig(check.NODE, bv)
 		runChecks(check.NODE, filename, detecetedKubeVersion)
 		writeOutput(controlsCollection)
+		os.Exit(exitCodeSelection(controlsCollection))
 	},
 	Deprecated: "this command will be retired soon. Please use the `run` command with `--targets=node` instead.",
 }
diff --git a/cmd/root.go b/cmd/root.go
index 785d021f3868015d097bce89597bbbd59caa92cc..ebfaa675d923c6fe8497e1b8e0db488b70a12f01 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -136,8 +136,7 @@ var RootCmd = &cobra.Command{
 		}
 
 		writeOutput(controlsCollection)
-		exitCode := exitCodeSelection(controlsCollection)
-		os.Exit(exitCode)
+		os.Exit(exitCodeSelection(controlsCollection))
 	},
 }
 
diff --git a/cmd/run.go b/cmd/run.go
index db92fe73c5d0c0a3b82ed888507f292a2c58078b..8dd39227562b6bfe326ee025f1ace60d4f612995 100644
--- a/cmd/run.go
+++ b/cmd/run.go
@@ -54,13 +54,15 @@ var runCmd = &cobra.Command{
 		path := filepath.Join(cfgDir, bv)
 		err = mergeConfig(path)
 		if err != nil {
-			fmt.Printf("Error in mergeConfig: %v\n", err)
+			exitWithError(fmt.Errorf("Error in mergeConfig: %v\n", err))
 		}
 
 		err = run(targets, bv)
 		if err != nil {
-			fmt.Printf("Error in run: %v\n", err)
+			exitWithError(fmt.Errorf("Error in run: %v\n", err))
 		}
+
+		os.Exit(exitCodeSelection(controlsCollection))
 	},
 }