diff --git a/BayesWaveUtils/scripts/megaplot.py b/BayesWaveUtils/scripts/megaplot.py
index c76a7e55c8fc6de5616bd0e2fd1e4303a10272c4..a70390c97be003c53a8bb08f92c091f3b01d572f 100755
--- a/BayesWaveUtils/scripts/megaplot.py
+++ b/BayesWaveUtils/scripts/megaplot.py
@@ -1220,7 +1220,7 @@ def plot_model_dims(modelList, ifoList, ifoNames, plotsDir, fullOnly_flag=0):
   if fullOnly_flag==1:
       intChainFile = 'chains/'+str(jobName)+"full_model.dat.0"
       N = len(open(intChainFile).readlines())
-      chains = np.loadtxt(intChainFile,skiprows=N/2)
+      chains = np.loadtxt(intChainFile,skiprows=int(N/2))
       chains = np.transpose(chains)
 
   else:
@@ -1228,7 +1228,7 @@ def plot_model_dims(modelList, ifoList, ifoNames, plotsDir, fullOnly_flag=0):
 
       intChainFile = 'chains/'+str(jobName)+"{0}_model.dat.0".format(mod)
       N = len(open(intChainFile).readlines())
-      chains = np.loadtxt(intChainFile,skiprows=N/2)
+      chains = np.loadtxt(intChainFile,skiprows=int(N/2))
       chains = np.transpose(chains)
       if mod == 'glitch':
         glitchChains = chains[3:3+len(ifoList)]