pedantic improvements and make VC++ happy