fix windows warnings and compilation errors