Fix montior tests to handle the monitor stopped event correctly