Fix some error

  - Generate rnd failed with null value
  - GetSlotId returns wrong value