Still more OS X changes

Also has a fix when `ENABLE_DEBUG_MODE` is defined.