Minor changes to Profiling code and some optimizations to Random array to mitigate some possible errors in the generation of arrays.