Filesystem changes

Small changes to avoid truncating empty files