removed redundant comments.
added format string annotations.
fixed format strings for std::size_t values.
added assertion.
added annotations to silence Visual Studio's static analyzer warnings.
fixed a potential memory leak and silenced a Visual Studio's static analyzer warning.
fixed handedness check.