Fix building on OS X

These are actually very simple changes. Not really sure if e7c5dd7 breaks the build on Linux. Travis will find out :)