Fixed VS2010 build warnings/errors