Added SharePoint definitions and fixed bugs.