fixed some segmentation faults with interface in filesystem.c