minor portability build fixes