Avoid error message on shutdown when MBeans are not registered.
Add another exception test