Text mode cleanup