Fix build on OSX. Closes issue #181