Fix the issues with rewritten tests (for leveldb)