bugfix: in 2DSTATS, instead of using intrinsic summation in homogeneous direction, perform a manual loop

- this has been the case of SEGMENTATION FAULT on low memory systems when dealing with large amounts of data
- optimiziation can be increased back to O3