Patches by AMK to check that the db is still open.
3 files changed