Fixed potential crash in transferStackInSlot method