some bug fixes: files need to be opened in binary mode (strangely only under windows but it's a bug) and some compilers (M$) don't seem to optimize all expressions from left to right (a && b)