Fixed a bug in stat.