Fix build errors with c++11