Merge in 3295 with minor changes

https://github.com/dimagi/commcare-hq/pull/3295