Fix issues found with pull request #1114