merge PR 1048
fixes to make stuff compile
fix merge error
Merge pull request #1083 from natefinch/merge-1048

Merge 1048

This merges PR #1048, which is a prerequisite for merging PR #1075 which is needed for 1.21.  The merge for 1075 will come after this one.