Minor portability fixes