fixed file deletion issues in segments test