Change the way files are opened
Fix test