Fix deref
Finish foreign key test