more work / fixes to the database library