fixes to leveldb