Merge "Fix some issues with Microsoft SQL Server support"