Fix OS X compile issues