More improvements in auto close and iwatch... scripts