Fixed validation code for windows

There was a hidden character (probably end line character) in my output
file, causing the != check of the strings to fail...
Improved logging
merged upstream into master