Fix bug with random not resetting