Fixes and enables test for unregistering Monitor listeners

The test MonitorsTest.shouldUnregister() was failing with a ClassCastException.
 The reason was that it was doing the cast on a field different than the one that
 it was performing the instanceof check. This error is now fixed and the test
 passes.