added test on statistics, fixed poblems