Fixing several bugs and regressions
Allow re-creating closed databases in an in-memory environment