added debugging options to master to behave sporadically, and a test case to make sure the slave can deal with it