Bug688 v1.1

Rebased version of previous patchset.