fixed binary file mode on Windows; removed trailing whitespace