Fix windows compilation.
Misc Cleanup.