OS X compile fix and extra safety while parsing headers