Windows fix & used code removed
Merge pull request #564 from imapp-pl/pr-fixes

Windows fix