Adding 'instance_id' and 'master_id' to records.