Allow for an empty database
Further python3 cleanup