Fix issues on OS X