fix a bug for memset in gaia algorithm.