Better OSX support

This cleans up warnings and fixes `make` on OSX.