Better random numbers.
Added debug code for layout calls to save *.gml files.