Fix test failure of scan_test