Improved random fraction generator.