Make it possible to configure the sampler for percentile stats
Fix some python syntax errors