Fix bug reported on SQLite mailing list.