Fixed file I/O (maybe?)