merge 09f1c00667ecb2bfe192721b3ab08f13b602b506, refs #1070 and #1066