Fix a bug from stable/4.0.x