Bug fix for script that produces summary stats across time interval