C++11 correctness fix.
Don't break strict aliasing rules.
Consistently use size_t over int, squelches some warnings.