OS X fixes

No longer seg fault on launch.