Fixes to SharePoint Download code