Added a missed foreign key.
Association tests.
Merge branch 'hotfix/0.1.3.1'