Fixes some return without va_end in the api, adds tests.

Also makes the CTL bad argument handling more consistent to avoid mistakes
 like that in the future.  Also updates the variable duration docs.
7 files changed