Fixing typos and random number generator initialization