Suprimed stupid warings of VS2010 and fix a few errors.

At least is working when Sigma is being build as static lib. Tested with VS2010