[OS X] Fixed build on OS X

Closes #1122