Portability fixes.
Minor portability fixes.