This is already solved in master. and now you don't need to do all that stuff.. just send the object that you have as results that usually will be a Map.
Can you take a look at the method called completeWithResults? Can you test with the latest snapshots to see that it's working?
Cheers