*: more portability fixes by Dan Fandrich