Make 'write_connection' variable default to 'connection' if not set in models.