Adding correct foreign key serialisation and tests.