Portability fixes for Solaris