Bug fixes and a few improvements. Used by ANTLR 3.1 to normalize newlines in output to what local machine wants.