Fixed wrong 'write_connection' variable name for models.