Fixing code for c++11