Clean up the result state from executing commands.