Fixing some problems in the docs and add more test randomization