OS X fixes

Meisaka already got this to.