Fixing performance issue introduced by #16

...

...
Merge branch 'stats_test' into github_master-dev