Fix errors in Pull Request #3777