Unix fixes. still not usable on Linux.