Adding extra namespace before "random"
Fixing compile errors in templates