fixes for vc++ CRT