Fixed detection of databases via --listdb