Added missed include of <sys/stat.h>