Merge "Extra sanity checks on sample size and resolution" into klp-dev