Add unit test and a small fix for the sendAll() method.
Add unit test and a small fix for the sendAll() method.