Make compile on OSX

(cherry picked from commit 1005ecfd7bff36e9be7942ecf20cbe8c23ae1169)