multiple fixes in scripts
improve statistics, add script to collect statistics automatically