Flatten and rename error stuff