Fixed file_write