Issue #997
Issue #971
Merge pull request #1000 from waveney/wav29

Couple of fixes