fixes for MS Visual C++