Fix build-time segfault on OSX (fixes #188)