Fixing some misc. bugs on unix.