Fix various C++11 issues and strict aliasing violations.