Fix bug in stats preparation