Relation fixes
Partial implementation of db filling script