This patch attempts to fix regressions reported for pull# 12320. Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>