Add empirical CDF generator; fix bugs.