Correcting artifact and group ids.