randstring and fixes
minors fixes and rand for endstring