Merge small changes from a much larger pull request
Merge pull request #2374 from Benglin/WarningFixes

Merge small changes from a much larger pull request