Eliminated compilation warnings
Slight improvement
The input functions now check for read errors and EOF.