Fix a typo in get_instances that broke modifying fields

Also added a test case to cover this behavior.

The error was:

TypeError: unsupported operand type(s) for +: 'builtin_function_or_method' and 'int'

And it's because model.id was being set to the builtin function "id"
instead of the variable "n" from the enumerator.