Osx monotonic

I'm opening this PR because it looks like the fixes for #81 were made to this branch but never merged. I'm unable to build from master on OSX, but I am able to build when using this branch. Can this be merged?