Fix #1652.
Fix conflict between changes in #1641 and #1642