Updated shutdown procedure to include unregistration of handler and
observer.