Fix some more typos and errors and a lack of attention during the initial port from SQL Server,
which *does* differ somewhat.