Backout pull request 3697

Pull request #3697  had some merge errors.