TextReader fixes, main not functional