Some minor improvements to Sqlite3

Will be used to implement #559 under Linux.