Fixed possible infinite recursion in random snippet.