Clean composition before end it

If the composition is not clean, the content will be committed as
output.