Fix build on OSX

Review 956 by @jdoliner