Fix some portability problems in the previous change.