Fix overrun when checking for HWMesh magic