Fix bugs on setting seed.