Fix aliasing and C++11 issues, Part I