more portable-code changes