fixed a few warnings/errors when compiling with VS2010