portability fixes for header inclusion etc.