Apply PR #2828 comments