Leveldb fixing

Looks good, worked first few rounds, pulling it ...