add const to char
improved efficiency of random generation in linux. change in tests.