Fixing bug: nEvents needs to be integer if used in a loop variable. Exposed by moving from Python2 --> 3