Improve basetest to fix external bug in practice