Cleaning up after flattening.