Round one of fixes to try to avoid musl-specific changes.