Changes to compile on Windows (not entirely done yet)