Fix a buffered file bug