KS test and discrete distribution
The KS test (sometimes) deliveres strange P values as it is evaluated on discrete distributions, one might need to force the number of bins in the output layer to ~100 (a high number). See NOTE3 in the KolmogorovTest() in the root TH1 Class Reference.