Fixed OSX build
Improved C++11 support