Fixed a bug in stat.c