This should fix the first error and some of the annoying error messages with the plugin closed. The second problem I cannot reproduce, I tried setting the old backend, as indicated
here, but I didn't get that message. Hopefully it will go away with the other fix, otherwise maybe you can send me your test library (and settings), or someone else can help.
As far as I can see, that's an internal problem of calibre, maybe triggered by something wrong in the plugin, but it's happening in
legacy.py, line 556
Edit: Ah... yes, I can reproduce the error when switching libraries with the plugin window open. I guess that's because I'm not updating the "db" attribute after library change.