Added option to use a in-memory working database