Okay - I checked in a fix.
Note with this method, there is a small risk. If sendmany finds inputs exactly equal to the outputs, there won't be a change output, and the ticket won't be valid. The GUI includes a check for this, but with sendmany you're on your own with that.