Forward port of client mode delete from 1.4

Manually applied patch generated from diff of PR@1022 on 1.4 branch.
The branch invovled a number of other modules that weren't needed
and made the merge too hard.

Original PR #1022 merged against 1.4 (for 1.4.11 release)
in commit 1fbb8156068e203cfe3997c79fa50bef1a03b9ee