Fixed huge bug regarding memcpy size mixup