Fixing some bugs in clear-button