Fixed problems with occurrence counter and statistics