Fix read and open files