Finish logindb_open function (Fixed #4)