Changed logindb_open to use new struct. Fixed #2