Adding defensive code in gen-twise-and-random script that marcelo done.