Fix modification of file --> process never ended + add tests