Improve LMDB support