Misc fixes to make this build with musl and/or pcc.