Fixes found while building on OS X