Fix compile errors on OpenIndiana (OpenSolaris)