Fixes for SQL 3.1.4