Some code tweaks in the Clear sample