Fixed a bunch of database relationship bugs, trying to actually populate it.