diff --git a/tools/combine_ics.py b/tools/combine_ics.py
index 64f255a61934bc3667fdb5934f74a206013e4872..d864c67d7d44fb6550e3cd858c50bb660d6126ca 100755
--- a/tools/combine_ics.py
+++ b/tools/combine_ics.py
@@ -41,7 +41,7 @@ import numpy as np
 # Store the compression level
 gzip_level = 4
 if len(sys.argv) > 3:
-    gzip_level = sys.argv[3]
+    gzip_level = int(sys.argv[3])
 
 # First, we need to collect some information from the master file
 main_file_name = str(sys.argv[1])[:-7]