File reading fix