Bugfix: fix the criteria of refstack_defcore