Fix bugs in JS mock broadcaster