portability fixes