File I/O has been improved for portability across platforms and some bugs fixed.

File I/O has been improved for portability across platforms and some bugs fixed.