portability fixes (Linux)