Ye API

and a couple of minor fixes
Merge pull request #1139 from waveney/wav31

Ye API