Fix bug in anki db update code