Made some improvements to the clear command