listener/broadcast bug fixes and lots of tests