Portability fixes for test suite.