utils: added 'flatten' method
stats_utils: correction