some bugfixes in statistics