Fix mem leaks, update flags before calling Fuse callback functions