Fixed model instance initialization with ForeignKeys.

This cuts the number of test failures on SQLite down to 52 and errors to
112.