backport of f3372bac91eafceafaa3da516a861d06b7246297 from trunk, closes #675
merge 36b9acd596e8c40f76817b1f3b284cad517e5024, refs #675