A few commits related to CDF-223 and CDF-225

@pamval please review.