Fixes for HPUX and Solaris

HPUX most likely will require more attention on the near future, but this should get us to a stable point now.