Added option to use an in-memory working database