Make leveldb safer