Better unix compatibility changes

Did some minor changes in a cleaner way.