Fix for building on OSX/Clang.

Fixes #1034.