Fix segfault when no input given when adding number of random items.