Fix testcase with in-memory database