Bug fixes from previous commit allowing different sgp.quantiles to be passed