Fix regression caused by refactor