Merging in some stuff from OSX