fixed a bunch of c++11 problems