Linux portability fixes