Fix account clear reference issue and add UT