Fixes for setting of random string

Change-Id: Id35e94f27a2cf023cb761e4ba45420d631360e5b