Reformatted withVS2010
Update for R2-1
Fix compiler warnings
Fix compiler warnings
Fix compiler warnings