fix some bugs in cfs.c & cfs.h