Fix bug in service/random index