merge aab476a0a5bc1d1622c3edf4f8b92dc3ef3ca6ae, refs #1073 and #1074