Fixes to make compilation work with c++11. (#7626)