memset, memcpy, sizeof consistency fixes