Latest changes from my branch, including VC++ fixes for errors and warnings.