Use more io functions.
more new io functions and typo-fixes.