backport of 7ab8652b2fd9d48af01a75cf3742c9d3085c398c from trunk, closes #655
merge 1652e82ac560d62801ebb59b170df5e3eab9c33c, refs #655