Add debug information in lib/lib.database.
Fix leftover login from teamid conversion