Re-submit of #815
rebased onto 97dbd5fade8c27abf166d79244ffbb5044b82840
Pull-Request has been merged by bcotton
Re-submit of #815
815 can be closed.