Added fix for windows, cleaned up unit tests