minor portability fixes