Added error checking to fseek() calls.
Improved fread() error checking.