Fix bug detected in PR