even more portability fixes