Fix regressions

This pull request fixed regressions caused by #2718.