fixup ugly hs, compiled from md, and fix random gen