Tweaks to your pull request

Could you check my changes to your code work on your Windows machine? Then I'll merge them in as part of the main pull request. Thanks!