Fixes windows compilation to pass all unit tests
Adds more unit tests