MAC OS X fixes