Bunch of updates after work on Mac OS X