change the way to clear SmartRefTable
fix several bugs