Rework detection and handling of ndbm: we now check for a working