Pr2529 randstring and more

Minor fixes like asked by @wchen-r7