More sqlite fixes