Big fixes and edits to fix msftidy comments

Bug fixes and edits to fix msftidy comments and recommendations from
MSF Team