Fixed warnings on win.
Refactoring.