Fixed networklink foreign keys, as well as another bug that was breaking database initialization.